x86/hvm: simplify hvmemul_do_io()
authorPaul Durrant <paul.durrant@citrix.com>
Tue, 23 Jun 2015 16:07:03 +0000 (18:07 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 23 Jun 2015 16:07:03 +0000 (18:07 +0200)
commit3036e653612bac89d5ca6800ef8e0597f2a63a1a
treefc20539c8931b8a4c5785a278ac5ced43e03f568
parent64cb2c00d544d7d2b0beb4f93ed4851eeab8c567
x86/hvm: simplify hvmemul_do_io()

Currently hvmemul_do_io() handles paging for I/O to/from a guest address
inline. This causes every exit point to have to execute:

if ( ram_page )
    put_page(ram_page);

This patch introduces wrapper hvmemul_do_io_addr() and
hvmemul_do_io_buffer() functions. The latter is used for I/O to/from a Xen
buffer and thus the complexity of paging can be restricted only to the
former, making the common hvmemul_do_io() function less convoluted.

This patch also tightens up some types and introduces pio/mmio wrappers
for the above functions with comments to document their semantics.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/emulate.c
xen/arch/x86/hvm/io.c
xen/include/asm-x86/hvm/emulate.h